<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
            //获取字符编码
            var s1 = "aA";
            console.log("a=",s1.charCodeAt(0));
            console.log("A=",s1.charCodeAt(1));
            var s2 = "张三";
            console.log("张=",s2.charCodeAt(0));
            console.log("三=",s2.charCodeAt(1));
            var code = s2.charCodeAt(0);
            var res = code.toString(16);
            console.log(res);
            var s3 = "\u5f20"
            console.log(s3);

    </script>
</head>
<body>
    
</body>
</html>